package me.jessyan.mvparms.demo.mvp.model.service;


import java.util.List;

import io.reactivex.Observable;
import me.jessyan.mvparms.demo.mvp.model.Api;
import me.jessyan.mvparms.demo.mvp.model.entity.BaseJson;
import okhttp3.MultipartBody;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

/**
 * Created by wangweitong on 2017/10/14.
 */
public interface CommonService {
    String HEADER_API_VERSION = "Accept-Encoding: application/json";

    /**
     * 获取手机验证码
     * @param mobile
     * @return
     */
    @Headers({HEADER_API_VERSION})
    @GET("/home/api/send_validate_code")
    Observable<BaseJson<String>> authCode(@Query("type")  String type, @Query("mobile")  String mobile, @Query("scene")  int scene);

    @Headers({HEADER_API_VERSION})
    @Multipart
    @POST("/api/"+ Api.APP_VERSION +"/upload/uploadFile")
    Observable<BaseJson<String>> upload(@Part("type")Object type,@Part List< MultipartBody.Part> partList);

}
